﻿#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->tabWidget->addTab(new QWidget, QStringLiteral("这是一个很长的tab名称"));
    connect(ui->tabWidget->tabBar(), &QTabBar::tabCloseRequested, this, [=](int index){
        if(index != -1)
        {
            ui->tabWidget->removeTab(index);
        }
    });
}

Widget::~Widget()
{
    delete ui;
}
